package com.health.platform.common.sys.organization.controller;

import com.health.platform.common.restful.AppResponse;
import com.health.platform.common.sys.organization.entity.OrganizationEntity;
import com.health.platform.common.sys.organization.entity.UnitEntity;
import com.health.platform.common.sys.organization.service.OrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>区划查询Controller</p>
 * <p>创建日期：2021-02-20</p>
 *
 * @author zhou-qf
 */
@RestController
@RequestMapping("/organization")
public class OrganizationController {

    @Autowired
    private OrganizationService organizationService;

    /**
     * 通过条件查询区划列表信息
     * @param organizationEntity 查询条件
     * @return 结果
     */
    @RequestMapping("getOrganization")
    public AppResponse getOrganization(@RequestBody OrganizationEntity organizationEntity){
        return organizationService.getOrganization(organizationEntity);
    }

    /**
     * 查询机构等级
     * @return 结果
     */
    @RequestMapping("getUnitLevel")
    public AppResponse getUnitLevel(){
        return organizationService.getUnitLevel();
    }

    /**
     * 通过条件查询机构列表信息
     * @param unitEntity 查询条件
     * @return结果
     */
    @RequestMapping("getUnit")
    public AppResponse getUnit(@RequestBody UnitEntity unitEntity){
        return organizationService.getUnit(unitEntity);
    }
}
